-
Notifications
You must be signed in to change notification settings - Fork 403
quarto use brand improvements #13880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Contributor
Author
|
TODO: support brand.yaml schema and types to only select logos and font files referenced from brand.yml |
Fall back to current working directory when no _quarto.yml project is found, allowing the command to work in single-file mode. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When `quarto use brand` encounters a brand extension (has _extension.yml with contributes.metadata.project.brand), it now: - Detects the extension in the staged directory (root, _extensions/*, or _extensions/*/*) - Uses the extension directory as the source - Excludes _extension.yml from being copied - Renames the brand file (e.g., brand.yml) to _brand.yml Also updates tests: - Scenario 8 now tests single-file mode (no _quarto.yml) - Adds Scenario 15 for brand extension installation - Adds Scenario 16 for brand extension dry-run Fixes #13863 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
`quarto use brand` now only copies files that are explicitly referenced
in the brand YAML file, rather than copying all files in the source
directory. Referenced files include:
- The brand file itself (_brand.yml)
- Logo paths: logo.small, logo.medium, logo.large (string or light/dark)
- Named logo images: logo.images.<name> (string or {path, alt})
- Font files: typography.fonts[*].files[*] when source: file
Updates test fixtures to use various logo/font reference patterns:
- String form: logo.small: logo.png
- Object with alt: logo.images.main: {path: ..., alt: ...}
- Light/dark variants: logo.small: {light: ..., dark: ...}
- Font string: typography.fonts[*].files: ["path"]
- Font object: typography.fonts[*].files: [{path, weight, style}]
Adds unreferenced files to fixtures to verify they are NOT copied:
- README.md, unused-styles.css, notes.txt, template.html
- fonts/unused-italic.woff2, images/extra-icon.png
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
e0e8407 to
a251b80
Compare
Contributor
Author
|
Now it only copies the logos and font files explicitly referenced in Also properly deals with brand in a subdirectory, for Quarto extensions:
|
When a brand extension specifies a brand file in a subdirectory (e.g., contributes.metadata.project.brand: subdir/brand.yml), referenced files in that brand.yml are now correctly resolved relative to the brand file's directory, not the extension root. For example, if subdir/brand.yml references: - logo.png → looks for subdir/logo.png - images/nested-logo.png → looks for subdir/images/nested-logo.png The target paths in _brand/ preserve the relative structure from the brand file's perspective: - subdir/logo.png → _brand/logo.png - subdir/images/nested-logo.png → _brand/images/nested-logo.png Adds test fixture and scenario 17 for brand extensions with subdirectory brand files including nested referenced paths. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ability to use brand without project and with brand extension.
If there's no project, create
_brand/in document directory.quarto useQuarto brand extensions; fixesquarto use brandshould also work with Quarto brand extensions #13863Only copy logo/font files explicitly listed in
_brand.yml